<?php
/**
 * @Author: Xu Liu email:2867557054@qq.com
 * @Date:   2016-12-15 13:31:33
 * @Last Modified by:   Xu Liu
 * @Last Modified time: 2018-01-03 15:15:42
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
class mobileplugin_jameson_read
{
    function global_header_mobile(){
        global $_G;
        if($_GET['mod']=='space' && $_GET['do']=='thread' && $_GET['type']!='reply'){
            foreach ($GLOBALS['list'] as $key => $value) {
                if(C::t('#jameson_read#jamesonread_colums')->isColum($key)){
                    unset($GLOBALS['list'][$key]);
                }
            }
            return '';
        }
    }
}
class mobileplugin_jameson_read_forum extends mobileplugin_jameson_read
{
    public function index_top_mobile()
    {
        global $_G;
        loadcache('plugin');
        $css    = trim(C::t('common_setting')->fetch('xf512read_mbstyle'));
        $return = '<a class="external" data-ajax="false" href="./plugin.php?id=jameson_read&contrl=touch&act=index" id="jameson_hookbutton" style="'
            . $css
            . '" >'
            . $_G['cache']['plugin']['jameson_read']['jamesonread_title']
            . '</a>';
        return $return;
    }
    public function viewthread_top_mobile()
    {
        global $_G;
        $columinfo = C::t('#jameson_read#jamesonread_colums')->fetch_colum_bytid($_G['tid']);
        if ($columinfo) {
            dheader("location:./plugin.php?id=jameson_read&contrl=touch&act=read&tid=" . $columinfo['tid'] . '&pid=' . $columinfo['pid']);
        }
    }
}